Skip to content

Fully generated clients #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 18, 2019
Merged

Fully generated clients #1

merged 16 commits into from
Jan 18, 2019

Conversation

JonathanHenson
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@JonathanHenson JonathanHenson requested a review from a team January 15, 2019 22:20

namespace Aws
{
namespace Iotjobs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird namespace capitalization

In the model, it's written namespace aws.iotjobs because Java doesn't capitalize namepaces. Neither does python, so that worked well for me. since c++ doesn't really have a style, maybe just stick with all-lowercase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're going to come back to this once we figure out the smithy model namespacing stuff.

Aws::Crt::Optional<Aws::Crt::String> ThingName;

private:
static void LoadFromObject(DescribeJobExecutionRequest &obj, const Crt::JsonView &doc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trivial style questions about static void LoadFromObject:

  1. Why have this function at all, you could just put the implementation in the constructor?
  2. Why is this static, but SerializeToObject isn't static?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer

class AWS_IOTJOBS_API DescribeJobExecutionRequest final
{
public:
DescribeJobExecutionRequest() = default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super trivial: I heard it helps compile times if you mark things default in the cpp file instead. Otherwise anyone including the header generates the code for the default implementations.

DescribeJobExecutionRequest:: DescribeJobExecutionRequest() = default;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer

{
Aws::Crt::JsonObject jsonObject;
Execution->SerializeToObject(jsonObject);
object.WithObject("execution", std::move(jsonObject));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trivial: It might be more graceful if the SerializeToObject() functions just returned a JsonObject, instead of taking one by argument. Then these 3 lines could just be:

object.WithObject("execution", Execution->SerializeToObject())

It would be no less efficent, because return value elision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer

class UpdateJobExecutionResponse;
class UpdateJobExecutionSubscriptionRequest;

using OnSubscribeComplete = std::function<void(int ioErr)>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An advantage of using a shared code between services, is that we could have a common Aws::Iot::OnSubscribeComplete type instead of N different Aws::IotserviceX::OnSubscribeComplete types. That would probably make life easier for customers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer


bool SubscribeToUpdateJobExecutionAccepted(
const Aws::Iotjobs::UpdateJobExecutionSubscriptionRequest &request,
Aws::Crt::Mqtt::QOS qos,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not let users pick qos, and always used 1. Let's talk offline about how all the SDKs should go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be in the habbit of making decisions like this for users.... especially C++ users.

@JonathanHenson JonathanHenson merged commit 66aaa05 into master Jan 18, 2019
@JonathanHenson JonathanHenson deleted the prototype branch January 18, 2019 00:35
@JonathanHenson JonathanHenson mentioned this pull request Apr 2, 2019
yourslab referenced this pull request in yourslab/aws-iot-device-sdk-cpp-v2 Apr 22, 2021
Initial work on mqtt bindings for cpp, a sample app, and a simple tes…
bretambrose added a commit that referenced this pull request Jul 22, 2021
@GasparVardanyan GasparVardanyan mentioned this pull request Jan 4, 2024
@lanceyao1009 lanceyao1009 mentioned this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants